{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "import plotly.express as px\n",
    "from plotly.subplots import make_subplots\n",
    "import plotly.graph_objects as go\n",
    "from ydata_profiling import ProfileReport"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [],
   "source": [
    "df = pd.read_csv('data/salaries_cyber.csv')\n"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 1247 entries, 0 to 1246\n",
      "Data columns (total 11 columns):\n",
      " #   Column              Non-Null Count  Dtype \n",
      "---  ------              --------------  ----- \n",
      " 0   work_year           1247 non-null   int64 \n",
      " 1   experience_level    1247 non-null   object\n",
      " 2   employment_type     1247 non-null   object\n",
      " 3   job_title           1247 non-null   object\n",
      " 4   salary              1247 non-null   int64 \n",
      " 5   salary_currency     1247 non-null   object\n",
      " 6   salary_in_usd       1247 non-null   int64 \n",
      " 7   employee_residence  1247 non-null   object\n",
      " 8   remote_ratio        1247 non-null   int64 \n",
      " 9   company_location    1247 non-null   object\n",
      " 10  company_size        1247 non-null   object\n",
      "dtypes: int64(4), object(7)\n",
      "memory usage: 107.3+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "data": {
      "text/plain": "         work_year        salary  salary_in_usd  remote_ratio\ncount  1247.000000  1.247000e+03    1247.000000   1247.000000\nmean   2021.316760  5.608525e+05  120278.218925     71.491580\nstd       0.715501  1.415944e+07   70291.394942     39.346851\nmin    2020.000000  1.740000e+03    2000.000000      0.000000\n25%    2021.000000  7.975450e+04   74594.500000     50.000000\n50%    2021.000000  1.200000e+05  110000.000000    100.000000\n75%    2022.000000  1.600800e+05  150000.000000    100.000000\nmax    2022.000000  5.000000e+08  910991.000000    100.000000",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>work_year</th>\n      <th>salary</th>\n      <th>salary_in_usd</th>\n      <th>remote_ratio</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>count</th>\n      <td>1247.000000</td>\n      <td>1.247000e+03</td>\n      <td>1247.000000</td>\n      <td>1247.000000</td>\n    </tr>\n    <tr>\n      <th>mean</th>\n      <td>2021.316760</td>\n      <td>5.608525e+05</td>\n      <td>120278.218925</td>\n      <td>71.491580</td>\n    </tr>\n    <tr>\n      <th>std</th>\n      <td>0.715501</td>\n      <td>1.415944e+07</td>\n      <td>70291.394942</td>\n      <td>39.346851</td>\n    </tr>\n    <tr>\n      <th>min</th>\n      <td>2020.000000</td>\n      <td>1.740000e+03</td>\n      <td>2000.000000</td>\n      <td>0.000000</td>\n    </tr>\n    <tr>\n      <th>25%</th>\n      <td>2021.000000</td>\n      <td>7.975450e+04</td>\n      <td>74594.500000</td>\n      <td>50.000000</td>\n    </tr>\n    <tr>\n      <th>50%</th>\n      <td>2021.000000</td>\n      <td>1.200000e+05</td>\n      <td>110000.000000</td>\n      <td>100.000000</td>\n    </tr>\n    <tr>\n      <th>75%</th>\n      <td>2022.000000</td>\n      <td>1.600800e+05</td>\n      <td>150000.000000</td>\n      <td>100.000000</td>\n    </tr>\n    <tr>\n      <th>max</th>\n      <td>2022.000000</td>\n      <td>5.000000e+08</td>\n      <td>910991.000000</td>\n      <td>100.000000</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda3\\envs\\pytorch\\lib\\site-packages\\ydata_profiling\\profile_report.py:363: UserWarning: Try running command: 'pip install --upgrade Pillow' to avoid ValueError\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "data": {
      "text/plain": "Summarize dataset:   0%|          | 0/5 [00:00<?, ?it/s]",
      "application/vnd.jupyter.widget-view+json": {
       "version_major": 2,
       "version_minor": 0,
       "model_id": "6723a182a68c4f4db7cb10243eaf725f"
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": "Generate report structure:   0%|          | 0/1 [00:00<?, ?it/s]",
      "application/vnd.jupyter.widget-view+json": {
       "version_major": 2,
       "version_minor": 0,
       "model_id": "63235a3629a84e008c4584fd399bf137"
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": "Render HTML:   0%|          | 0/1 [00:00<?, ?it/s]",
      "application/vnd.jupyter.widget-view+json": {
       "version_major": 2,
       "version_minor": 0,
       "model_id": "0317434ac4514342b21219ca6cf9c414"
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": "Export report to file:   0%|          | 0/1 [00:00<?, ?it/s]",
      "application/vnd.jupyter.widget-view+json": {
       "version_major": 2,
       "version_minor": 0,
       "model_id": "c5f4c8f5c3f240aeb3c9fcd937eefadd"
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "report = ProfileReport(\n",
    "    df,\n",
    "    title=\"Cyber Security Salaries Profile\"\n",
    ").to_file('Data_21250125.html')"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
